package ex;


import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class N4 {
    public static void main(String[] args) {
       int [] a={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33};
       int [] b={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
       String [] c={"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16",};
        Random r =new Random();
        int[] a1=new int[6];
        String[]c1=new String[1];
        for(int i = 0;i < 6; i++ ){
                int r1 = r.nextInt(33);
                if (b[r1]==0) {
                    a1[i] = a[r1];
                    b[r1]=1;
                }else {
                    i--;
                }
            }
        int r2=r.nextInt(16);
        c1[0]=c[r2];

        a1 = select(a1);
        System.out.println(Arrays.toString(a1)+Arrays.toString(c1));
        }
    public static int[] select(int[] a1) {
        for (int i=0;i<a1.length-1;i++) {
            for (int j=i+1;j<a1.length;j++) {
                if(a1[i]>a1[j]){
                    int temp = a1[i];
                    a1[i] = a1[j];
                    a1 [j] = temp;
                }
            }
        }
        return a1;


     }
}


       // System.out.println(a[1] + a[2] + a[3] + a[4] + a[5] + a[6]);




